# 项目控制文件
from FlaskPro import createApp
from config import Config
from flask_script import Manager,Command  #1、导包
from flask_migrate import MigrateCommand
app = createApp(Config)

#2、实例化
manager = Manager(app)

# 实现命令
class Hello(Command):
    def run(self):
        print("hello")

class Runserver8000(Command):
    def run(self):
        # 项目启动在8000端口
        app.run(port=8000)

# 绑定命令
manager.add_command("hello",Hello)
manager.add_command("runserver8000",Runserver8000)
manager.add_command("db",MigrateCommand)

if __name__ == '__main__':
    # app.run()
    manager.run()  #3、管理项目，调用run方法












